<?php
App::uses('AppController', 'Controller');
/**
 * PhuCaps Controller
 *
 * @property PhuCap $PhuCap
 * @property PaginatorComponent $Paginator
 * @property SessionComponent $Session
 */
class BillsController extends AppController {

/**
 * Components
 *
 * @var array
 */
	public $components = array('Paginator', 'Session');

/**
 * index method
 *
 * @return void
 */
	

/**
 * view method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */

/**
 * edit method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function edit($room_id = null,$reservation_id = null) {
		$this->Bill->recursive = 2;
		$r_id = $this->params['pass'][0];
		$re_id = $this->params['pass'][1];
		$bill = $this->Bill->find('first',array('conditions'=>array('Bill.rooms_id'=>$r_id,'Bill.reservations_id'=>$re_id,'Bill.status'=>1)));
		$this->loadModel('Service');
		$services =  $this->Service->find('list',array('conditions'=>array('Service.status'=>1)));
		$this->set(compact('bill','services'));		
		debug($bill);
	}

	public function payment($guest_id = null){
		// Function thanh toán "tất cả" các phòng cho khách hàng
	}

	public function max_hour($id = null){
		$id = 1;
		$this->loadModel('PriceTime');
		$array_hour = $this->PriceTime->find('all',array('conditions'=>array('PriceTime.type'=>1,'PriceTime.caterooms_id'=>$id)));
		$this->set(compact('array_hour'));
		debug($array_hour);
	}
/**
 * delete method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	
}
